﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeBehind="Listtb.aspx.cs" Inherits="lcs.Web.Admin.instore.Listtb" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script language="javascript" src="/js/CheckBox.js" type="text/javascript"></script>
    <script src="../../My97DatePicker/WdatePicker.js"></script>
     <link href="../../jquery-ui.min.css" rel="stylesheet" />
    <script src="../../js/jquery.js"></script>
    <script src="../../js/jquery-ui.min.js"></script>
     <script type="text/javascript">
         $(function () {
             $("#<%# txtgys.ClientID%>").autocomplete({
                 minLength: 1, // 设置搜索的关键字最小长度// 设置自动完成列表的函数，函数包括两个参数，requset和response      
                 source: function (request, response) {
                     $.ajax({
                         type: "POST",          // 通过request.term可以获得文本框内容   
                         url: "../../HandlerSupply.ashx?keyword=" + request.term,
                         contentType: "application/json; charset=gb2312",
                         dataType: "json",
                         success: function (data) {
                             // jQuery.map(array, callback) :将一个数组中的元素转换到另一个数组中。
                             //  下面就是把数组["value1", "value2",...]转换为[{value:"value1"}, {value:"value2"},...]                 
                             response($.map(data, function (item) {
                                 return { value: item };
                             }));
                         },
                         error: function () {
                             alert("ajax请求失败");
                         }
                     });
                 }
             });
         });
         
         </script>
     <style type="text/css">
        .aline_center
        {
            margin-left: auto;
            margin-right: auto;
            overflow: hidden;
        }
        body
        {
            font-size: 10pt;
        }
         .auto-style1 {
             width: 200px;
             height: 41px;
         }
    </style>
    <script language="javascript" type="text/javascript">

        function printpage(myDiv) {

            //var newstr = document.all.item(myDiv).innerHTML; 
            var newstr = document.getElementById(myDiv).innerHTML;
            //alert(newstr);
            var oldstr = document.body.innerHTML;
            document.body.innerHTML = newstr;
            window.print();
            document.body.innerHTML = oldstr;
            return false;
        }
    </script>
    <script type="text/javascript">
        (function ($) {
            var printAreaCount = 0;
            $.fn.printArea = function () {
                var ele = $(this);
                var idPrefix = "printArea_";
                removePrintArea(idPrefix + printAreaCount);
                printAreaCount++;
                var iframeId = idPrefix + printAreaCount;
                var iframeStyle = 'position:absolute;width:0px;height:0px;left:-500px;top:-500px;';
                iframe = document.createElement('IFRAME');
                $(iframe).attr({
                    style: iframeStyle,
                    id: iframeId
                });
                document.body.appendChild(iframe);
                var doc = iframe.contentWindow.document;
                $(document).find("link").filter(function () {
                    return $(this).attr("rel").toLowerCase() == "stylesheet";
                }).each(
                        function () {
                            doc.write('<link type="text/css" rel="stylesheet" href="'
                                    + $(this).attr("href") + '" >');
                        });
                doc.write('<div class="' + $(ele).attr("class") + '">' + $(ele).html()
                        + '</div>');
                doc.close();
                var frameWindow = iframe.contentWindow;
                frameWindow.close();
                frameWindow.focus();
                frameWindow.print();
            }
            var removePrintArea = function (id) {
                $("iframe#" + id).remove();
            };
        })(jQuery);
        $(function () {
            $("#btnPrint").click(function () { $("#printContent").printArea(); });
        });
        function preview() {
            $("#print").printArea();
        }
    </script>

   
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">


            <table style="width: 100%;" cellpadding="2" cellspacing="1" class="border">
                <tr>
                    <td style="width: 80px" align="right" class="tdbg">
                         &nbsp;</td>
                    <td align="left">                       
                         <b>日期：</b><asp:DropDownList ID="ddldate" runat="server">
                            <asp:ListItem Value="=">等于</asp:ListItem>
                            <asp:ListItem Value="&gt;">大于</asp:ListItem>
                            <asp:ListItem Value="&lt;">小于</asp:ListItem>
                        </asp:DropDownList>
                    <asp:TextBox ID="txtKeyword" runat="server" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd',readOnly:true})" Width="89px"></asp:TextBox>
                    &nbsp;供应商：<asp:TextBox ID="txtgys" runat="server"></asp:TextBox>
                        &nbsp;<asp:Button ID="btnSearch" runat="server" Text="查询"  OnClick="btnSearch_Click" >
                    </asp:Button>                    
                        
                    </td>
                    <td class="auto-style2">                       
                        &nbsp;</td>
                    <td class="tdbg">
                    </td>
                </tr>
            </table>
            <!--Search end-->
            <br />
    <div class="aline_center" style="text-align: center">
        <div id="printContent">

   <div id='myDiv'>
            <div class="aline_center" style=" text-align:center;font-size: 40px; font-weight: bold; font-family: 黑体">
                &nbsp;入 库 单</div>
            <div style="margin: 10px;">
                <table class="aline_center" style="width: 17cm;">
                    <tr>
                        <td style="text-align: left; height: 20px;">
                            <b>入库日期：</b><asp:Label ID="lbl_time" runat="server"></asp:Label>
                            
                        </td>
                        <td style="text-align: left; height: 20px;">
                           <b>仓库：</b><asp:Label ID="lblstore" runat="server"></asp:Label></td>
                    </tr>
                    <tr>
                        <td style="text-align: left; height: 20px;" colspan="2">
                            <b>供应商</b>：<asp:Label ID="lblsupplier" runat="server"></asp:Label>
                        </td>
                    </tr>
                    <tr>
                        <td style="text-align: left; height: 20px;" colspan="2">
                            <!--<b>接收人</b>：<asp:Label ID="lbl_receive_userName" runat="server"></asp:Label>
                            ，<b>接收人电话</b>：<asp:Label ID="lbl_receive_userPhone" runat="server"></asp:Label>-->
                        </td>
                    </tr>
                   
                    <tr>
                        <td style="text-align: left; height: 20px; text-align: center" colspan="2">
            <asp:GridView ID="gridView" runat="server"  Width="100%" 
                   OnRowDataBound="gridView_RowDataBound" ShowFooter="True"
                    AutoGenerateColumns="False"  RowStyle-HorizontalAlign="Center" >
                    <Columns>
                            
                        <asp:TemplateField HeaderText="物料名">
                            <EditItemTemplate>
                                <asp:TextBox ID="TextBox4" runat="server" Text='<%# Bind("material") %>'></asp:TextBox>
                            </EditItemTemplate>
                            <FooterTemplate>
                                合计
                            </FooterTemplate>
                            <ItemTemplate>
                                <asp:Label ID="Label1" runat="server" Text='<%# Bind("material") %>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
		<asp:TemplateField HeaderText="项目名称">                            
                            <ItemTemplate>
                                <asp:Label ID="Label1" runat="server" Text='<%# Decode(Eval("projectname").ToString()) %>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>                  
                         <asp:TemplateField HeaderText="数量">
                                        <ItemTemplate>
                                            <asp:Label ID="lbl_nums" runat="server" Text='<%# Bind("innum") %>'></asp:Label>
                                        </ItemTemplate>
                                        <EditItemTemplate>
                                            <asp:TextBox ID="TextBox3" runat="server" 
                                                Text='<%# Bind("innum") %>'></asp:TextBox>
                                        </EditItemTemplate>
                                    </asp:TemplateField>
                            
                        <asp:BoundField DataField="unit" HeaderText="单位" />
                                    <asp:TemplateField HeaderText="单价">
                                        <ItemTemplate>
                                            <asp:Label ID="lbl_unprice" runat="server" Text='<%# Bind("unitPrice") %>'></asp:Label>
                                        </ItemTemplate>
                                        <EditItemTemplate>
                                            <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("unitPrice") %>'></asp:TextBox>
                                        </EditItemTemplate>
                                    </asp:TemplateField>
                                    <asp:TemplateField HeaderText="金额">
                                        <ItemTemplate>
                                            <asp:Label ID="lbl_totalPrice" runat="server"></asp:Label>
                                        </ItemTemplate>
                                        <EditItemTemplate>
                                            <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
                                        </EditItemTemplate>
                                        <FooterTemplate>
                                             <asp:Label ID="lbl_totalAllPrice" runat="server"></asp:Label>
                                        </FooterTemplate>
                                    </asp:TemplateField>
                        </Columns>
                <PagerStyle CssClass="mypager" />
<RowStyle HorizontalAlign="Center"></RowStyle>
                </asp:GridView>

                        </td>
                    </tr>
                    <tr>
                        <td style="text-align: left; font-weight: bold; height: 20px;" colspan="2">
                        </td>
                    </tr>
                    <tr>
                        <td style="text-align: left; font-weight: bold; " class="auto-style1">
                            会计：&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 保管： </td>
                        <td style="text-align: left; font-weight: bold; " class="auto-style1">
                            部门领导： </td>
                    </tr>
                </table>
            </div>
        </div>

        </div>
               <table border="0" cellpadding="0" cellspacing="1" style="width: 100%;">
                <tr>
                    <td style="width: 1px;">                        
                    </td>
                    <td align="left">
                        <input type="button" id="btnPrint" value="打 印" />
                    </td>
                </tr>
            </table>
        </div>
</asp:Content>
